<?php include_once './application/views/sys_admin/common/header.php';  ?>
<div id="dialog" title="用户信息" style="display:none"> <div id="view_response"></div></div>
<div id="dialog2" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
<div class=" definewidth m20">
		<form  class="form-inline definewidth m20" action="" method="get" id="formb" name="formb">
  			用户名：<input type="text" id="username" name="username" value="<?php echo $parms['username'];?>" />
  			Email：<input type="text" id="email" name="email" value="<?php echo $parms['email'];?>" />
  			真实姓名：<input type="text" id="realname" name="realname" value="<?php echo $parms['realname'];?>" />
  			注册时间：<input type="text" id="add_time" name="add_time" style="width: 100px;" value="<?php echo $add_time;?>"  onfocus="WdatePicker()"  class="Wdate" />
  			<button type="button" class="btn btn-success"  onclick="this.form.submit();" >查询</button>
  		</form>
		<table class="table table-bordered table-hover definewidth m10">
			 <thead>
			    <tr>
			      <th><strong>ID</strong></th>
						<th><strong>会员名</strong></th>
						<th><strong>手机号</strong></th>
						<th><strong>姓名</strong></th>
						<th><strong>性别</strong></th>
						<th><strong>身份证号</strong></th>
						<th><strong>正面</strong></th> 
						<th><strong>反面</strong></th>
						<th><strong>状态</strong></th>
						<th><strong>操作</strong></th>
			    </tr>
			   </thead>
			 <?php foreach($user_list as $info){?>
			  <tr id="row_<?php echo $info['user_id'];?>">
			  	<td><?php echo $info['user_id'];?></td>
				<td><a href="javascript:showUser(<?php echo $info['user_id'];?>);"><?php echo $info['username'];?></a></td>
				<td><?php echo $info['phone'];?></td>
				<td><?php echo $info['realname'];?></td>
				<td><?php if ($info['sex'] == 1) echo "男";else echo "女";?></td>
				<td><?php echo $info['card_id'];?></td>
				<td ><a <?php if(isset($info['card_pic1'])&& !empty($info['card_pic1'])) echo "href = /".$info['card_pic1'];?> target = "_blank" ><img style="width:200px; height:100px;"  src="<?php echo "/".$info['card_pic1'];?>"/></a></td>
				<td ><a <?php if(isset($info['card_pic2'])&& !empty($info['card_pic2'])) echo "href = /".$info['card_pic2'];?> target = "_blank" ><img style="width:200px; height:100px;"  src="<?php echo "/".$info['card_pic2'];?>"/></a></td>
				<td><?php if ($info['real_status'] == 0) echo "未认证";elseif($info['real_status'] == 1) echo "已认证";else echo "待认证审核";?></td>
				
				<td>
					
					<a href="javascript:if(confirm('确定审核实名认证通过？')){remove(<?php echo $info['user_id'];?>,1);}">认证成功</a>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="javascript:if(confirm('确定审核实名认证拒绝？')){remove(<?php echo $info['user_id'];?>,0);}">认证失败</a>
					
					

				</td>
			  </tr>
			  
			  <?php }?>
			  	
		</table>
		<div class="invbd_page"><?php echo $this->pagination->create_links();?></div>
<script>
	//解除锁定确认
	function remove(id,status){
		
		$.ajax({
			type: "post",
			url: "/sys_admin/user/verify_realuser/",
			data: "user_id="+id+"&status="+status,
			success: function(msg){
				
				$("#dialog2" ).dialog();
				if(msg == 1){
					$("#msg").html("操作成功！");
					$("#row_"+id).hide();
				}else{
					
					$("#msg").html("操作失败，请联系超级管理员！");
				}
				setTimeout(function(){
					$("#dialog2" ).dialog("close");
				},3000);
			},
			dataType: "text"
	});
		
		
	}

</script>
</div>
